package com.web.exiaodao.remote.controller;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;

import com.web.webstart.base.constant.XaConstant;
import com.web.webstart.base.controller.BaseController;
import com.web.webstart.base.exception.BusinessException;
import com.web.webstart.base.util.result.XaResult;
import com.web.webstart.base.util.jpa.WebUitl;
import com.web.exiaodao.remote.service.ApiUsingHelpService;
import com.web.exiaodao.remote.vo.UsingHelpVo;

/**
 * @Title: ApiUsingHelpController.java
 * @Package com.web.exiaodao.remote.controller
 * @Description: 使用帮助信息接口
 * @author eason.zt
 * @date 2015年3月23日 下午1:00:00
 * @version V1.0
 */
@Api(value = "UsingHelp", description = "使用帮助接口", position = 10)
@Controller
@RequestMapping("/api/usingHelp")
public class ApiUsingHelpController extends BaseController {

	@Autowired
	private ApiUsingHelpService usingHelpService;
	
	/**
	 * @Title: findUsingHelpList
	 * @Description: 查询所有使用帮助信息
	 * @return    
	 */
	@ApiOperation(value="查询所有使用帮助",notes="查询所有使用帮助信息,当返回的code=1时，取出object进行显示,存放为数组对象")
	@ResponseBody
	@RequestMapping(value="findUsingHelpList",method=RequestMethod.POST)
	public XaResult<List<UsingHelpVo>> findUsingHelpList(
	) throws BusinessException{
		XaResult<List<UsingHelpVo>> xr = new XaResult<List<UsingHelpVo>>();
		Pageable pageable = WebUitl.buildPageRequest(0, Integer.MAX_VALUE, "[{property:'createTime',direction:'DESC'}]");
		Map<String , Object> filterParams =  WebUitl.getParametersStartingWith("{}", "search_");
		return usingHelpService.findListEQStatusByFilter(XaConstant.Status.valid, filterParams, pageable);
	}
}

